<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div></div>
    <div></div>
    <div></div>
    <script>
        //1 扩展运算符可以将数组转换为序列
        const number = ['1','2','3'];

        function print(){
            console.log(arguments);
        }

        print(number);//如果这样的话，arguments获取的是数组实参对象
        print(...number);//如果这样的话，arguments获取的是数组中每一个元素的序列
        //相当于print('1','2','3')

        //2 扩展运算符的应用
        const number1 = ['1','2','3'];
        const number2 = ['4','5','6'];
        //(1)用于数组的合并
        const mergeNumber = [...number1,...number2];
        console.log(mergeNumber);
        //(2)用于克隆数组
        const copyNumber = [...number1];
        console.log(copyNumber); 
        //(3)将伪数组转为数组
        const divs = document.querySelectorAll("div");
        console.log(divs);
        const divArr = [...divs];
        console.log(divArr);
    </script>
</body>
</html>